<!--黑名单企业详细-->
<template>
  <div class="container">
    <topTitle
      :titleText="titleText"
      :back="back"
      :showEdit="cashDepositInfo.status !== 'RETURN'"
      @editBack="toUpdate"
      @gobackTriser="goBack"
    ></topTitle>
    <div class="mainCon">
      <el-row v-if="cashDepositInfo.status === 'RETURN'">
        <el-col>
          <!-- <div class="infoTitle">
            <span>状态: {{ cashDepositInfo.statusDesc || "--" }}</span
            >&nbsp;&nbsp;
            <span>退还日期：{{ cashDepositInfo.actReturnDate || "--" }}</span>
          </div> -->
          <div class="detail">
            <div class="content">
              <span class="icon iconfont iconyiqueren status2"></span>
              <div class="info">
                <p>
                  状态：<span class="status2">{{
                    cashDepositInfo.statusDesc || '--'
                  }}</span>
                </p>
                <p class="infoItems">
                  <span
                    >退还日期：{{ cashDepositInfo.actReturnDate || '--' }}</span
                  >
                </p>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row class="detailInfo">
        <el-row class="detailInfoItemSty">
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >项目名称：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">{{
              cashDepositInfo.projectName || '--'
            }}</span>
          </el-col>
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >保证金类型：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">{{
              cashDepositInfo.typeDesc || '--'
            }}</span>
          </el-col>
        </el-row>
        <el-row class="detailInfoItemSty">
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >银行保函保证金：</span
            >
            <span class="gridContent contentSty color666 fontSizeF"
              >{{ cashDepositInfo.bankTotal || '0' }}元</span
            >
          </el-col>
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >商业保险保证金：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">
              <span class="gridContent contentSty color666 fontSizeF"
                >{{ cashDepositInfo.insuranceTotal || '0' }}元</span
              >
            </span>
          </el-col>
        </el-row>
        <el-row class="detailInfoItemSty">
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >第三方担保保证金：</span
            >
            <span class="gridContent contentSty color666 fontSizeF"
              >{{ cashDepositInfo.tripartiteTotal || '0' }}元</span
            >
          </el-col>
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >现金形式保证金：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">
              {{ cashDepositInfo.cashTotal || '0' }}元</span
            >
          </el-col>
        </el-row>
        <el-row class="detailInfoItemSty">
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >应退日期：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">{{
              cashDepositInfo.shouldReturnDate || '--'
            }}</span>
          </el-col>
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >缴纳凭证：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">
              <span v-if="cashDepositInfo.fileHandList.length > 0">
                <span>已上传</span>
                <el-link
                  class="seeFile"
                  @click="toUploadFile()"
                  style="margin-top: -2px"
                  >查看</el-link
                >
                <contractEnclosureDialog
                  v-if="uploadContract"
                  dialogTitle="缴纳凭证"
                  :tableData="cashDepositInfo.fileHandList"
                  @closeDialog="hiddenDialog"
                ></contractEnclosureDialog>
              </span>
              <span v-else>未上传</span>
            </span>
          </el-col>
        </el-row>
        <el-row class="detailInfoItemSty">
          <el-col :span="12" class="labelWidthSty">
            <span class="gridContent color333 fontSizeF fontWeight"
              >退还凭证：</span
            >
            <span class="gridContent contentSty color666 fontSizeF">
              <span v-if="cashDepositInfo.fileBackList.length > 0">
                <span>已上传</span>
                <el-link class="seeFile" @click="toUploadFileTwo()"
                  >查看</el-link
                >
                <contractEnclosureDialog
                  v-if="uploadContractTwo"
                  dialogTitle="退还凭证"
                  :tableData="cashDepositInfo.fileBackList"
                  @closeDialog="hiddenDialogTwo"
                ></contractEnclosureDialog>
              </span>
              <span v-else>未上传</span>
            </span>
          </el-col>
        </el-row>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: 'threeTermsCashDepositDetail',
  data() {
    return {
      titleText: '查看详情',
      back: true,
      cashDepositInfo: {
        fileHandList: [],
        fileBackList: [],
      },
      id: '', //列表传过来的主键id
      uploadContract: false,
      uploadContractTwo: false,
    }
  },
  created() {
    this.id = this.$route.query.id
    this.getInfo()
  },
  methods: {
    getInfo() {
      this.axios({
        method: 'post',
        url: 'api-d/trinomial/expand/detail',
        data: {
          id: this.id,
        },
      })
        .then(
          (response) => {
            if (!response.data.hasError) {
              this.cashDepositInfo = response.data.result
            } else {
              this.$message({
                type: 'error',
                message: '数据获取失败',
              })
            }
          },
          (response) => {}
        )
        .catch((error) => {})
    },
    goBack() {
      this.$router.push('/home/cashDeposit/threeTermsCashDeposit')
      this.$store.commit('GOBACK_NAME', {
        oldUrl: '/home/cashDeposit/threeTermsCashDeposit',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
    toUpdate() {
      this.$router.push({
        path: '/home/cashDeposit/threeTermsCashDepositAdd',
        name: 'threeTermsCashDepositAdd',
        query: {
          fromType: 'detail',
          id: this.id,
        },
      })
      this.$store.commit('CHANGE_SLIDER_NAME', {
        oldUrl: '/home/cashDeposit/threeTermsCashDeposit',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
    toUploadFile() {
      this.uploadContract = true
    },
    hiddenDialog() {
      this.uploadContract = false
    },
    toUploadFileTwo() {
      this.uploadContractTwo = true
    },
    hiddenDialogTwo() {
      this.uploadContractTwo = false
    },
  },
}
</script>

<style lang="less" scoped>
.mainCon {
  top: 198px;
  padding: 0 !important;
  .infoTitle {
    font-size: 16px;
    padding: 16px 24px;
    background: #f5f7fb;
    margin-bottom: 24px;
    color: #333;
    margin: 0 16px;
  }
}

.blockquote {
  color: #333;
  font: bold 16px Microsoft YaHei;
  border-bottom: 1px solid #dee5f4;
  height: 35px;
  margin-top: 40px;
}

.blockquote:before {
  background-color: #009588;
  content: '';
  padding: 2px;
  margin-right: 10px;
}

.labelWidth {
  font-size: 14px;
  color: #666666;
  display: inline-block;
  height: 36px;
  text-align: right;
}

.information {
  font-size: 14px;
  color: #151515;
}

.detailInfo {
  padding: 0 24px;
}

.detailInfoItem {
  margin-top: 20px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.detail {
  padding: 20px 24px;
  border-bottom: 10px solid #f5f7fa;
  .content {
    background: #f8f9fb;
    padding: 16px 24px 16px 76px;
    position: relative;
    height: 74px;
  }
  .info {
    display: inline-block;
    height: 42px;
    line-height: 42px;
    p {
      line-height: 18px;
      font-size: 18px;
    }
    .statusCheck {
      line-height: 42px;
    }
    .infoItems {
      color: #333333;
      margin-top: 10px;
      line-height: 14px;
      font-size: 14px;
      i {
        display: inline-block;
        vertical-align: bottom;
        width: 0px;
        height: 14px;
        border: 1px solid #dbdbdb;
        margin: 0 20px;
      }
    }
  }
}
.iconfont {
  position: absolute;
  top: 19px;
  left: 24px;
  display: inline-block;
  font-size: 36px;
  margin-right: 16px;
}
.status2 {
  color: #06ac15;
}
</style>
